var _logout = 'logout.jsp';

/*
 * User logout.
 */
function ev_logout(){
  if (parent!=null){
  	 parent.window.location = contextPath + ((contextPath!='/')? '/' + _logout: _logout);
	 return;
  }
  parent.window.location = contextPath + ((contextPath!='/')? '/' + _logout: _logout);
}
/*
 * Save button in the banner.
 */
function ev_save(){
	obj = parent.window.detail.document.all('myForm:cmdSave');
	if(obj != null && obj.disabled !=null &&  !obj.disabled){
		obj.click();
	}else{
		alert('You are not in the edit work!');
	}
}




/**
 * initialize the check box according the values.
 * @param c The check box.
 * @param v The values.
 */

function initializeChx(c,v){
	if (c.length!=null){
	  for (var i=0; i<c.length; ++i ) {
		  v2 = c[i].value;
		  v2 = (v2.indexOf('||')>=0) ? v2.substring(0,v2.indexOf('||')) :v2;
		  c[i].checked = (v.indexOf(v2+';') >=0);
	  }
	}
}
